﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Windows.Forms;

namespace QuanLyCongViec.Database
{
    class SystemGlobal
    {
        public SqlConnection conn;
        public SqlConnection Connection()
        {
            string ConnectionString = @"Data Source=SERVER2K3\SQLSV2005;Initial Catalog=QLCongViec;User ID=sa;Password=123";
            conn = new SqlConnection(ConnectionString);
            return conn;
        }
        public string Replace(string strSource, params object[] arrobjCouple)
		{
			if (strSource == null || string.Equals(strSource, "")) return "";
			if (arrobjCouple == null || arrobjCouple.Length < 1) return strSource;
			StringBuilder strbd = new StringBuilder(strSource);
			for (int i = 0; i < arrobjCouple.Length; i += 2)
			{
				strbd.Replace(Convert.ToString(arrobjCouple[i]), Convert.ToString(arrobjCouple[i + 1]));
			}
			return strbd.ToString();
		}
    }
}
